<?php

class RDOProxy implements IRDOProxy {

    private $rdo;
    private $dbms;
    private $host;
    private $database;
    private $username;
    private $password;

    public function __construct($dbms, $host, $database, $username, $password) {
        $this->dbms = $dbms;
        $this->host = $host;
        $this->database = $database;
        $this->username = $username;
        $this->password = $password;
    }

    public function makeConnection() {
        if ($this->rdo == null) {
            if ($this->dbms == "mysql") {
                $this->rdo = new MySQLRDO($this->host, $this->database, $this->username, $this->password);
            } else {
                return null;
            }
        }
        return $this->rdo;
    }

}
